<?php

class User extends CI_Model {

    private $userID;
    private $username;
    private $password;

    function __construct() {
        // Call the Model constructor
        parent::__construct();
    }

    public function getUserID() {
        return $this->userID;
    }

    public function setUserID($userID) {
        $this->userID = $userID;
    }

    public function getUsername() {
        return $this->username;
    }

    public function setUsername($username) {
        $this->username = $username;
    }

    public function getPassword() {
        return $this->password;
    }

    public function setPassword($password) {
        $this->password = $password;
    }

    public function userLogin($username, $password) {
        try {
            $this->db->where('username', $username);
            $this->db->where('password', $password);
            $query = $this->db->get('user');
            $rows = $query->result();
            return !empty($rows);
        } catch (Exception $e) {
            return FALSE;
        }
    }

}

?>
